//
//  LTCollectCell.m
//  LearnTeacher
//
//  Created by yang bo on 2024/4/13.
//

#import "LTCollectCell.h"
#import "LTFirstCollectModel.h"
@interface LTCollectCell ()
@property (weak, nonatomic) IBOutlet UIView *f_bgView;
@property (weak, nonatomic) IBOutlet UIImageView *f_vipLab;
@property (weak, nonatomic) IBOutlet UIImageView *f_coverImgV;
@property (weak, nonatomic) IBOutlet UIView *f_bookView;
@property (weak, nonatomic) IBOutlet UILabel *f_bookLab;
@property (weak, nonatomic) IBOutlet UILabel *f_descLab;

@property (weak, nonatomic) IBOutlet UIView *s_bgView;
@property (weak, nonatomic) IBOutlet UIImageView *s_vipLab;
@property (weak, nonatomic) IBOutlet UIImageView *s_coverImgV;
@property (weak, nonatomic) IBOutlet UIView *s_bookView;
@property (weak, nonatomic) IBOutlet UILabel *s_bookLab;
@property (weak, nonatomic) IBOutlet UILabel *s_descLab;

@property (weak, nonatomic) IBOutlet UIView *t_bgView;
@property (weak, nonatomic) IBOutlet UIImageView *t_vipLab;
@property (weak, nonatomic) IBOutlet UIImageView *t_coverImgV;
@property (weak, nonatomic) IBOutlet UIView *t_bookView;
@property (weak, nonatomic) IBOutlet UILabel *t_bookLab;
@property (weak, nonatomic) IBOutlet UILabel *t_descLab;


@end
@implementation LTCollectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.f_bookView.layer.cornerRadius = self.s_bookView.layer.cornerRadius = self.t_bookView.layer.cornerRadius = 9;
    self.f_bookView.layer.borderWidth = self.s_bookView.layer.borderWidth = self.t_bookView.layer.borderWidth = 0.5;
    self.f_bookView.layer.borderColor = self.s_bookView.layer.borderColor = self.t_bookView.layer.borderColor = rgbHex(0x2979FF, 0.5).CGColor;
    self.f_bookView.layer.masksToBounds = self.s_bookView.layer.masksToBounds = self.t_bookView.layer.masksToBounds = YES;
    
   
}

- (void)setList:(NSArray *)list {
    _list = list;
    _f_bgView.hidden = _s_bgView.hidden = _t_bgView.hidden = YES;
    _f_vipLab.hidden = _s_vipLab.hidden = _t_vipLab.hidden = YES;
    _f_bookView.hidden = _s_bookView.hidden = _t_bookView.hidden = YES;
    if(list.count > 0) {
        LTFirstCollectModel *model = list[0];
        _f_bgView.hidden = NO;
        [_f_coverImgV sd_setImageWithURL:[NSURL URLWithString:model.cover_full]];
        _f_descLab.text = model.productName;
    }
    if(list.count > 1) {
        LTFirstCollectModel *model = list[1];
        _s_bgView.hidden = NO;
        [_s_coverImgV sd_setImageWithURL:[NSURL URLWithString:model.cover_full]];
        _s_descLab.text = model.productName;
    }
    if(list.count > 2) {
        LTFirstCollectModel *model = list[2];
        _t_bgView.hidden = NO;
        [_t_coverImgV sd_setImageWithURL:[NSURL URLWithString:model.cover_full]];
        _t_descLab.text = model.productName;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
